#ifndef HASH_H
#define HASH_H
#include <string>
#define SHA256_BLOCK_SIZE 32
typedef unsigned char BYTE;
typedef struct {
    BYTE data[64];  // current 512-bit chunk of message data, just like a buffer
    unsigned int datalen;   // sign the data length of current chunk
    unsigned long long bitlen;  // the bit length of the total message
    unsigned int state[8];  // store the middle state of hash abstract
} SHA256_CTX;

class Hash
{
public:
    Hash();
    void sha256_init(SHA256_CTX *ctx);
    void sha256_update(SHA256_CTX *ctx,  BYTE data[], size_t len);
    void sha256_final(SHA256_CTX *ctx, BYTE hash[]);
    void sha256_transform(SHA256_CTX *ctx,  BYTE data[]);
};

#endif // HASH_H
